﻿using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MoetutuServer.Helper.RepairHelper
{
    class TagAdd
    {
        public static void StartRepair(String UserInfoPath, String PostId, string CnTag,string JpTag) {

 
            string Content = Helper.RepairHelper.ModifyContent.GetContent(UserInfoPath, TextHelper.StringToInt(PostId));
            var htmlDoc = new HtmlDocument();
            htmlDoc.LoadHtml(Content);

            var htmlBody = htmlDoc.DocumentNode.SelectSingleNode("//ul[@class='wp-tag-out']");

            HtmlNode newPara = HtmlNode.CreateNode("<p>This a new paragraph</p>");

            htmlBody.ChildNodes.Add(newPara);
            Console.WriteLine(htmlDoc.DocumentNode.InnerHtml);
        }
    }
}
